package com.etlmaster.executor.steps.rowprocessor;

import java.util.HashMap;
import java.util.Map;

import com.etlmaster.executor.Step;
import com.etlmaster.executor.StepMeta;
import com.etlmaster.executor.annotation.StepInstruction;


@StepInstruction("rowProcessHbaseWriter")
public class HbaseWriterStep extends Step{

	private HbaseWriterStepMeta meta;
	public HbaseWriterStep(StepMeta meta) {
		super(meta);
		this.meta=(HbaseWriterStepMeta) meta;
	}

	@Override
	protected int handle() {
		Map<String,String> map=new HashMap<String,String>();
		map.put("type", "writer");
		map.put("id", meta.getId());
		map.put("name", meta.getName());
		map.put("code", meta.getId());
		map.put("class", "com.etlmaster.rowprocessor.steps.HbaseWriter");
		StringBuilder sb=new StringBuilder();
		sb.append("{\"tableName\":\"")
		.append(meta.getTableName())
		.append("\"}");
		map.put("param", sb.toString());
		return Bolt.runRowProcessor(meta, map);
	}

	@Override
	public boolean stop() {
		// TODO Auto-generated method stub
		return false;
	}

}
